// css混入


/**
 * 省略号
 */
@mixin text-overflow() {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}


@mixin text-overflow-line($line) {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: $line;
  /* autoprefixer: ignore next */
  -webkit-box-orient: vertical;
}

/**
 * 1px
 */
@mixin setTopLine($line-color: #C7C7C7) {
  content: " ";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  height: 1PX;
  border-top: 1PX solid $line-color;
  color: $line-color;
  transform-origin: 0 0;
  transform: scaleY(0.5);
  z-index: 1;
}

@mixin setBottomLine($line-color: #C7C7C7) {
  content: " ";
  position: absolute;
  left: 0;
  bottom: 0;
  right: 0;
  height: 1PX;
  border-bottom: 1PX solid $line-color;
  color: $line-color;
  transform-origin: 0 100%;
  transform: scaleY(0.5);
}

@mixin setLeftLine($line-color: #C7C7C7) {
  content: " ";
  position: absolute;
  left: 0;
  top: 0;
  width: 1PX;
  bottom: 0;
  border-left: 1PX solid $line-color;
  color: $line-color;
  transform-origin: 0 0;
  transform: scaleX(0.5);
}

@mixin setRightLine($line-color: #C7C7C7) {
  content: " ";
  position: absolute;
  right: 0;
  top: 0;
  width: 1PX;
  bottom: 0;
  border-right: 1PX solid $line-color;
  color: $line-color;
  transform-origin: 100% 0;
  transform: scaleX(0.5);
}

@mixin setLine($line-color: #C7C7C7) {
  content: " ";
  position: absolute;
  left: 0;
  top: 0;
  width: 200%;
  height: 1PX;
  border: 1PX solid $line-color;
  color: $line-color;
  height: 200%;
  transform-origin: left top;
  transform: scale(0.5);
}

/**
* 阴影
**/
@mixin shadow {
  box-shadow: 0 8px 20px 0 rgba(19, 25, 31, 0.3);
}


/**
* 渐变背景
**/
@mixin gradient($primary-color: #8cc5ff, $sub-color: #409EFF) {
  background: $primary-color;
  background: linear-gradient(160deg, $primary-color 0%, $sub-color 100%);
}

/**
 * 点击态
 */
@mixin active {
  transition: background-color 0.3s;

  &:active {
    opacity: .6;
    background-color: #f0f0f0;
  }
}

/**
 * 扩展点击区域
 */
@mixin extendClick {
  position: relative;

  &:after {
    content: '';
    position: absolute;
    top: -16px;
    left: -16px;
    right: -16px;
    bottom: -16px;
  }
}